<?php

// +----------------------------------------------------------------------
// | quanli team
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2020 http://www.fistforward.com/ All rights reserved.
// +----------------------------------------------------------------------
// | Author: create by allen.qiang
// +----------------------------------------------------------------------

/**
 * 配送员页面
 * @package  htdocs
 * @subpackage  quanliadmin
 * @author  create by allen.qiang
 */

quanli_require('module/base/system/sysDistributionTechnician.class.php');
quanli_require('module/base/system/sysDistribution.class.php');

class pa_distributionTechnician {

    public function execute() {

        if (isset($_REQUEST['operFlg']) && $_REQUEST['operFlg'] > 0) {

            switch ($_REQUEST['operFlg']) {

                case 1: // 配送员列表
                    $this->distributionTechnicianList();
                    break;

                default:
                    backendError();
                    break;
            }

        } else {

            backendError();

        }
    }

    /**
     *配送员列表页
     */
    private function distributionTechnicianList () {

        global $G_PGLOB;

        //实例配送站类
        $sysDistribution = new sysDistribution();

        //查询配送站信息
        $arg_array = array(
            'useFlg' => 1
        );
        $distribution_array = $sysDistribution->search( $arg_array );
        if (!$distribution_array) {
            backendError('配送站信息没有找到，请先添加配送站');
        }

        $G_PGLOB->smarty->assign_by_ref('distribution_array', $distribution_array);
        $G_PGLOB->smarty->assign('edit_permission', $G_PGLOB->has_permission(27));
        $G_PGLOB->smarty->display('system/distributionTechnicianList.tpl');

    }

}